package backend.search.controller;

import java.util.List;

import backend.search.manager.ProductSearchManager;

import com.opensymphony.xwork2.ActionSupport;

import core.product.model.Product;

public class ProductSearchAction extends ActionSupport {
	
	private static final long serialVersionUID = 14343L;
	private ProductSearchManager productSearchManager ;
	private String searchById ;
	private String searchByName; 
	private List<Product> products ;
	public ProductSearchAction()
	{
		productSearchManager =  new ProductSearchManager();
	}
	public String execute() 
	{
		this.searchById = this.getSearchById();
		this.searchByName=this.getSearchByName();
		this.products = productSearchManager.getSimpleSearchResult(this.searchById, this.searchByName);
		return SUCCESS ;
	}
	public String getSearchById() {
		return searchById;
	}
	public void setSearchById(String searchById) {
		this.searchById = searchById;
	}
	public String getSearchByName() {
		return searchByName;
	}
	public void setSearchByName(String searchByName) {
		this.searchByName = searchByName;
	}
	public List<Product> getProducts() {
		return products;
	}
	public void setProducts(List<Product> products) {
		this.products = products;
	}

}
